<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>用户管理列表页面</title>
<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript">
  $(function(){
	  
  });
  function getList(){
	  alert(2222);
  }
  function addUser(){
	  var user = {};
	  user.id = 1;
	  user.name = '杨峰';
	  user.birthday = "2018-01-12";
	  user.sex = '男';
	  $.ajax({
	  	url: "/users/",
	  	type: 'post',
	  	dataType:'json',
	  	contentType: "application/json; charset=utf-8",
	  	data:JSON.stringify(user),
	  	success:function (data) {
	  		//调用成功
	  		alert("成功");
	  	},
	  	error: function(data){
	  		//调用失败
	  		alert("失败");
	  	}
	  });
  }
  function deleteUser(){
	  alert(2222);
  }
  function updateUser(){
	  alert(2222);
  }
  function viewUser(){
	  alert(2222);
  }
</script>
</head>
<body>
   <button onclick="getList()">获取用户列表</button>
   <button onclick="addUser()">新增用户</button>
   <button onclick="deleteUser()">删除用户</button>
   <button onclick="updateUser()">修改用户</button>
   <button onclick="viewUser()">查看用户</button>
</body>
</html>